﻿using System;
using System.Text;
using Xunit;

namespace Unity.String.Tests.Number
{
    public class NumberBufferTest
    {
        [Fact]
        public void MethodsTest()
        {
            unsafe
            {
                var testNumberBuffer = new System.Number.NumberBuffer();
                
                
 
                byte[] testEmptyValueBytes = new byte[0];
                int testEmptyValueBytesLength = 0;
                //fixed (byte* testValueBytesPointer = testEmptyValueBytes)
                //{
                    //var testNumberBufferWithValue = new System.Number.NumberBuffer(
                    //    System.Number.NumberBufferKind.Integer, 
                    //    testValueBytesPointer, testEmptyValueBytesLength);
                    // byte* pointer = testNumberBufferWithValue.GetDigitsPointer();
                    //Assert.Equal(*testValueBytesPointer, *pointer);
                //} 
                
                int testValue = 123456;
                byte[] testValueBytes = BitConverter.GetBytes(testValue);
                int testValueBytesLength = 6;
                //fixed (byte* testValueBytesPointer = testValueBytes)
                //{
                    //var testNumberBufferWithValue = new System.Number.NumberBuffer(
                    //    System.Number.NumberBufferKind.Integer, 
                    //    testValueBytesPointer, testValueBytesLength);
                    //byte* pointer = testNumberBufferWithValue.GetDigitsPointer();
                    //Assert.Equal(*testValueBytesPointer, *pointer);
                //} 
                
                string testStringValue = "123456abcd";
                byte[] testStringValueBytes = Encoding.ASCII.GetBytes(testStringValue);
                int testStringValueBytesLength = 10;
                //fixed (byte* testStringValueBytesPointer = testValueBytes)
                //{
                    //var testNumberBufferWithValue = new System.Number.NumberBuffer(
                    //    System.Number.NumberBufferKind.Integer, 
                    //    testStringValueBytesPointer, testValueBytesLength);
                    //byte* pointer = testNumberBufferWithValue.GetDigitsPointer();
                    //Assert.Equal(*testStringValueBytesPointer, *pointer);
                //} 
                
            }    
        }
        
    }
}